package cn.xej.demo.mock;

import cn.xej.demo.condition.annotation.MockService;
import cn.xej.demo.service.AppleService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;

import javax.annotation.PostConstruct;

/**
 * @Author alicat.xu
 * @Date 2021/11/13 9:47 下午
 */
@MockService("appleService")
public class MockAppleServiceImpl implements AppleService {

    static {
        System.out.println("mock static apple");
    }

    @Override
    public String getPrice() {
        System.out.println("mock apple实现类");
        return "456";
    }

    @PostConstruct
    public void init(){
        System.out.println("初始化mock apple 实现类");
    }
}
